home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
maximus
/
mul100.zip
/
EXPWARN.SCR
< prev
next >
Wrap
Text File
|
1993-02-01
|
3KB
|
75 lines
// EXPWARN.SCR -- Maximus Warn of Pending Expiry -- Version 1.00
//
// Script program for MUL - the Maximus User Language
// MUL is (C) Copyright 1990-93 by CodeLand Australia
// ExpWarn scans your user file for records with a date expiry setting.
// Each record found is checked for a match of days to expiry with the
// 'warndays' variable setting. Where matches are found, the 'warnexp'
// command line entry is executed. This enables functions such as posting a
// message to warn users of a pending expiry. Several utilities exist to
// write to both *.msg and Sqsh message bases, the one used as an example
// here is MsgPost, a utility also by this author. Note that MsgPost v1.01
// or higher is required, because MsgPost v1.00 did not possess the -F and
// -L command line options.
// This script is based on the executable of the same name, also by
// this author, originally written for Simon Blears of 3:690/601.
char *ufile = "USER.BBS"; // Path & name of Maximus user file
//char *ufile = "C:\\BBS\\USER.BBS"; // Path & name of Maximus user file
int warndays=14; // Issue warning days before expiry
// Post a message to accounts with expiry pending in 'warndays' days
// In the example below, MsgPost will post a message to the user
// warning of the pending expiry.
char *warnexp = "MsgPost -TC:\\Util\\WarnExp.Txt \"-F%s\"";
char *banner = "EXPWARN v1.00"; // Script banner
char *desc = "Warn of Pending Expiry"; // Description
main () // Main program
{
printf ("\n%s - %s\n\n",banner,desc); // Announce
if (!BaseOpenR (ufile)) {
printf ("ERROR opening user file %s\n",ufile);
saybibi (); exit ();
}
scanufile (); // Process the user file
BaseClose (); // Close the user base
saybibi (); // Was it good for you too?
}
scanufile () // Process the user file
{
int rec=1;
char buf[128];
while (BaseRead (rec++)) { // Read all records
if (And (USRxpflag,XP_DATE)) { // If expire by date
if (BaseDaysXpry () == warndays) {
printf("Warning: %04u %-25s\n",rec,USRname);
sprintf (buf,warnexp,USRname);
system (buf);
}
}
}
}
// Byebye
saybibi ()
{
puts ("\nExpWarn done!\n");
}
// End of script